/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ve.com.cantv.worktables.ejb.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Ghust
 */
@Entity
@Table(name = "activity_to_activity_participant_type")
@NamedQueries({@NamedQuery(name = "ActivityToActivityParticipantType.findAll", query = "SELECT a FROM ActivityToActivityParticipantType a"), @NamedQuery(name = "ActivityToActivityParticipantType.findById", query = "SELECT a FROM ActivityToActivityParticipantType a WHERE a.id = :id")})
public class ActivityToActivityParticipantType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    private Integer id;
    @JoinColumn(name = "id_activiy", referencedColumnName = "idactivity")
    @ManyToOne(optional = false)
    private Activity idActiviy;
    @JoinColumn(name = "id_activity_partipant_type", referencedColumnName = "idapt")
    @ManyToOne(optional = false)
    private ActivityParticipantType idActivityPartipantType;

    public ActivityToActivityParticipantType() {
    }

    public ActivityToActivityParticipantType(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Activity getIdActiviy() {
        return idActiviy;
    }

    public void setIdActiviy(Activity idActiviy) {
        this.idActiviy = idActiviy;
    }

    public ActivityParticipantType getIdActivityPartipantType() {
        return idActivityPartipantType;
    }

    public void setIdActivityPartipantType(ActivityParticipantType idActivityPartipantType) {
        this.idActivityPartipantType = idActivityPartipantType;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ActivityToActivityParticipantType)) {
            return false;
        }
        ActivityToActivityParticipantType other = (ActivityToActivityParticipantType) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ve.com.cantv.worktables.ejb.entity.ActivityToActivityParticipantType[id=" + id + "]";
    }

}
